import MinRequest from './request.js'

const minRequest = new MinRequest()

// 请求拦截器
minRequest.interceptors.request((request) => {
  return request
})

// 响应拦截器
minRequest.interceptors.response((response) => {
  return response.data
})

// 设置默认配置
minRequest.setConfig((config) => {
  config.baseURL = 'http://127.0.0.1:3000'
  return config
})

export default {
  // 这里统一管理api请求
  apis: {
    demo () {
      return minRequest.get('/dish/group-by-category/restaurant/1')
    }
  }
}
// export function demo(){
// 	return minRequest.get('/restaurant/group-by-category/restaurant/1')
// }
